<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "article".
 *
 * @property int $id
 * @property string $title
 * @property string $content
 * @property string|null $ctime
 * @property int $status
 * @property int $type 1=平台公告    2 =帮助中心
 */
class Articles extends \yii\db\ActiveRecord {
    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return 'article';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['content'], 'required'],
            [['content'], 'string'],
            [['ctime'], 'safe'],
            [['status', 'type'], 'integer'],
            [['title'], 'string', 'max' => 80],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'content' => 'Content',
            'ctime' => 'Ctime',
            'status' => 'Status',
            'type' => 'Type',
        ];
    }
}